package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.UserPojo;
import org.apache.catalina.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserPojoMapper extends BaseMapper<UserPojo> {


    @Select("select * from user where user_id=#{userId} and user_pass=#{userPass}")
    @Results(id = "userbase",value = {
            @Result(id = true,column = "user_id",property = "userId"),
            @Result(column = "user_name",property = "userName"),
            @Result(column = "user_pass",property = "userPass"),
            @Result(column = "user_age",property = "userAge"),
            @Result(column = "user_sex",property = "userSex"),
            @Result(column = "user_tel",property = "userTel"),
            @Result(column = "user_card",property = "userCard"),
            @Result(column = "user_years",property = "userYears"),
            @Result(column = "user_job",property = "userJob")
        }
    )
    UserPojo selectpass(@Param("userId") Integer userId,@Param("userPass") String userPass);

    @Update("update user set user_pass=#{userPass} where user_id=#{userId}")
    int changepass(@Param("userId") Integer userId,@Param("userPass") String userPass);


}
